package cn.itcast.tanhua.sso.controller;


import cn.itcast.tanhua.common.service.PicUploadService;
import cn.itcast.tanhua.common.vo.PicUploadResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @ClassName PicUploadController
 * @Description 文件上传
 * @Author WU
 * @Date 2021/5/25 17:28
 * @Version 1.0
 */
@Controller
@RequestMapping("pic/upload")
public class PicUploadController {
    @Autowired
    private PicUploadService picUploadService;

    @PostMapping
    @ResponseBody
    public PicUploadResult upload(@RequestParam("file") MultipartFile file){
        return this.picUploadService.upload(file);

    }
}
